/**
给定一个二叉树的根节点 root ，返回它的 中序 遍历。
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode() : val(0), left(nullptr), right(nullptr) {}
 *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
 *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
 * };
 */
class Solution {
public:
    vector<int> inorderTraversal(TreeNode* root) {
        vector<int> n;
        order(root,n);
        return n;
    }
    void order(TreeNode* x,vector<int> &n){
        if(x==nullptr){
            return;
        }
        order(x->left,n);
        n.push_back(x->val);
        order(x->right,n);
    }
};